Charger External Power Device Gain Sampling

ABSTRACT

A power management unit accurately measures and controls charging current. The power management unit may be implemented more efficiently than prior designs, leading to cost savings in the implementation of the power management unit as well as in the implementation of the device that incorporates the power management unit. The power management unit incorporates a model of an external charge control device (e.g., a transistor) and uses that model in a way that allows the power management unit to eliminate external device pins and other circuitry.

1. PRIORITY CLAIM

The present application is a divisional application of U.S. patentapplication Ser. No. 13/526,768, filed Jun. 19, 2012, which is relatedto and claims priority from U.S. Provisional Patent Application Ser. No.61/660,388, filed Jun. 15, 2012, the contents of each of which arehereby incorporated herein by reference in their entirety.

2. TECHNICAL FIELD

This innovation relates to power supply charging, such as batterycharging. This innovation also relates to determining and controllingcharging current.

3. BACKGROUND

Immense consumer demand for electronic devices of every variety has beendriven in part by low cost manufacturing and ever increasing devicefunctionality. Today, it is not unusual for a person to own multiplecell phones, portable gaming devices, music players, tablet computers,or GPS devices, and other devices. One common feature of these devicesis that they depend heavily and sometimes exclusively on a rechargeablepower source, such as a rechargeable battery. Improvements in batterycharging will continue to make such devices attractive options for theconsumer.

BRIEF DESCRIPTION OF THE DRAWINGS

The innovation may be better understood with reference to the followingdrawings and description. In the figures, like reference numeralsdesignate corresponding parts throughout the different views.

FIG. 1 is an example of a device that incorporates a power managementunit.

FIG. 2 shows a traditional charge monitoring technique.

FIG. 3 shows an example of a power management unit that employs a powerdevice model to more efficiently monitor and control charging current.

FIG. 4 shows example implementation of a power management unit using adevice model.

FIG. 5 shows example waveforms of taking battery current measurements.

FIG. 6 is an example of how the device model may be implemented.

FIG. 7 is an example of soft start.

FIGS. 8, 9, and 10 represent different examples of how the powermanagement unit increases charging current toward a commanded value withdifferent loop feedback values.

FIGS. 11, 12, and 13 show different examples of how the power managementunit increases charging current toward a commanded value assumingdifferent gains for switching devices.

FIG. 14 shows logic that a power management unit may implement.

DETAILED DESCRIPTION

FIG. 1 shows an example of a device 100 that includes a power managementunit 102. In this example, the device 100 is a smartphone, but thedevice 100 could be any device that includes a rechargeable powersupply, including a portable video game, music or video player, laptopcomputer, tablet computer, or other device. The power management unit(PMU) 102 includes charging circuitry 104 and controls charging of thepower supply 106, including controlling the charging current to thepower supply 106. The external power source 108 supplies the chargingcurrent.

The power supply 106 may be a rechargeable battery, for example. Thechemistry of the rechargeable battery may vary widely. Examples includenickel metal hydride (NiMH), lithium ion (Li-ion), and lithium ionpolymer (Li-ion polymer) chemistries. The external power source 108 mayalso vary widely. As examples, the external power source 108 may be auniversal serial bus (USB) port, an alternative current (AC) powersocket, a direct current (DC) power supply, an AC wall adaptor thatoutputs a DC voltage, or any other power source.

The device 100 includes a communication interface 110, which mayinclude, as an example a wireless transceiver, an antenna, and a poweramplifier (PA) that drives the antenna. The device also includes systemlogic 112 and a user interface 114. The system logic 112 may include anycombination of hardware, software, firmware, or other logic. The systemlogic 112 and PMU 102 may be implemented, for example, in one or moresystems on a chip (SoC), application specific integrated circuits(ASIC), with discrete circuitry, or in other manners. The system logic112 is part of the implementation of any desired functionality in thedevice 100. As one example, the system logic 112 include a processor 116and a memory 118 in which the device functionality logic 120 (e.g.,applications in software or firmware) implements any desiredfunctionality. In that regard, the system logic 112 may facilitate, asexamples, running applications, accepting user inputs, saving andretrieving application data, establishing, maintaining, and terminatingcellular phone calls, wireless network connections, processing globalpositioning signals, Bluetooth connections, or other connections, anddisplaying relevant information on the user interface 114. The userinterface 114 may include a graphical user interface, touch sensitivedisplay, voice or facial recognition inputs, buttons, switches, andother user interface elements.

In particular, the system logic 112 may monitor charge status of thepower supply 106. To do so, the system logic 112 may communicate withthe power management unit 102 to monitor charging activity anddischarging activity with respect to the power supply 106. The systemlogic 112 may track the charging and discharging activity for thepurposes of rendering a fuel gauge 122 or other charge status indicatoron the user interface 114.

As noted above, the system logic 112 may include one or more processors118 and a memory 120. The memory 120 stores, for example, devicefunctionality logic 120 that the processor 118 executes to carry outwhatever device functionality is desired. In some implementations, thememory 120 may store a charging device model 124 and charging logic 126that facilitates monitoring and control over charging of the powersupply 106. In other implementations, the power management unit 102 mayincorporate all or part of the charging device model 124 and charginglogic 126. The memory 120 itself may be implemented as non-volatile (butoptionally reprogrammable) firmware memory, volatile system memory(e.g., SRAM or DRAM), or any combination of such memories. Accordingly,the charging device model 124 and charging logic 126 may be updated asdesired. For example, when an improved device model becomes available, anetwork controller (e.g., a base station) may communicate the improveddevice model to the device 100 with instructions to replace the olddevice model with the improved device model in the memory 120 or in thePMU 102.

The charging logic 104 may include external devices. In other words, notall of the circuitry employed to charge the power supply 106 isnecessarily included in a single ASIC or SoC that implements the powermanagement unit 102 or the system logic 112. In part, this is due to thefact that semiconductor manufacturing processes tend to tolerate up toabout 3 to 5 volts, while charging inputs are often specified towithstand input voltages of up to 20 volts or more, in case, forexample, someone connects the wrong charger to the device 100. As aresult, the power management unit 102 may employ external devices thatcan tolerate higher voltages to charge the power supply 106.

The power management unit 102 may monitor current through the externaldevices. In particular, the power management unit 102 may monitorcurrent through an external switching device through which current flowsto charge the power supply 106. The switching device may be a powertransistor, such as a PNP or FET power transistor, but the switchingdevice may be implemented in other ways depending on the particulardevice. Monitoring the current allows the power management unit 102 toensure that charging currents into the power supply 106 are withinacceptable bounds and to ensure that the charging currents that arebeing drawn from the power source 108 are within acceptable limits, asexamples. In addition, current monitoring allows the power managementunit 102 to track current into the power supply 106 while it ischarging, and current out of the power supply 106 while it is poweringthe device 100. Having tracked these currents, the power supply 106 mayprovide fuel gauge functionality (sometimes referred to as Coulombcounter functionality) that determines the charge level of the powersupply 106. In addition to current into and out of the power supply 106,the power management unit 102 obtains measurements of other currents,such as currents flowing to other loads, in order to ensure that thecurrents are within acceptable limits as noted above.

FIG. 2 shows an example of a traditional charge monitoring technique200. In FIG. 2, a USB external power source provides the chargingcurrent, I-charge, which flows through a switching device 204 (in thiscase a PNP power transistor) and the charging current sensing resistor206 to a power supply 208 (e.g., a rechargeable battery). The currentthrough the power supply 208, I-battery, flows through the batterycurrent sensing resistor 210 to ground. In addition, some of theI-charge flows to other parts of the device, such as to a radiofrequency power amplifier (RFPA) (e.g., to drive an antenna) and tosystem devices (e.g., digital logic). FIG. 2 labels these two currentsas I-RFPA and I-system. The current flowing to parts of the device otherthan the power supply 208 is referred to below as supplemental current,I-sup, and there may be additional, fewer, or different currents thatcompose I-sup, besides I-RFPA and I-system. I-charge=I-sup+I-battery,and for the example in FIG. 2, I-charge=I-system+I-RFPA+I-battery.

In FIG. 2, the voltage across the charging current sensing resistor 206provides a measure of I-charge. To measure I-charge, device pins 212convey the voltage across the charging current sensing resistor 206 tomeasurement circuitry 214 internal to the power management unit 200,such as an analog to digital converter (ADC). Similarly, the voltageacross the battery current sensing resistor 210 provides a measure ofI-battery. The measurement circuitry 216 internal to the powermanagement unit 200, such as a delta-sigma ADC, measures the voltageacross the battery current sensing resistor 210 to determine I-battery.Note that the charging current sensing resistor 206, measurementcircuitry 214, and device pins 212 are needed in the design shown inFIG. 2 to determine I-charge, because measuring I-battery is not thesame as measuring I-charge due to the supplemental currents. Thepresence of the current sensing resistor 206, measurement circuitry 214,and device pins 212 add complexity and cost to the design.

FIG. 3 shows a charging design 300 in which the power management unit102 uses a charging device model 124. The charging configuration 300eliminates the charging current sensing resistor 206, the measurementcircuitry 214 internal to the power management unit, as well as thedevice pins 212. As a result, the charging design 300 may result in aless complex and costly design for the device 100.

The charging design 300 includes driving circuitry 302, regulators 304,and voltage measurement logic, such as a successive approximation (SAR)analog to digital converter (ADC) 306 which measures power supplyvoltage, and a fuel gauge delta-sigma ADC 308 with measures I-batterythrough the battery current measurement inputs 320. The drivingcircuitry 302 may be a DAC with 10-14 bit resolution operating at 2-30mega samples per second (MS/s) to drive the switching device 204,directly or indirectly, through the switching device control output 322.The regulators 304 provide whatever voltages (e.g., 3.3 V or 5 V) areused by any other circuitry in the device 100. The SAR ADC 306 may have8 to 12 bits of resolution and operate at 0.2-1 MS/s, while the fuelgauge ADC may have 12-14 bits of resolution and operate at 5-15 KS/s.The specifications of any of the circuitry in the charging design 300may vary depending on the implementation of the PMU 102.

As shown in FIG. 3, the charging logic 104 also includes the functionalblocks 310. The functional blocks may include a constantcurrent/constant voltage loop 312, power limiting logic 314, timers 316,and protection logic 318. FIG. 4 illustrates one example of the way inwhich the functional blocks 312 may be implemented.

In the charging design 300, driving circuitry 302 drives current intothe base of the power transistor 204. The driving circuitry 302 may beimplemented as a digital to analog converter (DAC), for example. Inparticular, the driving circuitry 302 adjusts the operating point of thepower transistor 204 to allow a desired amount of I-charge to flow fromthe external power source 108. As will be described in more detailbelow, the PMU 102 intelligently controls the power transistor 204 toobtain measurements of I-charge without the additional circuitry shownin FIG. 2.

In the charging design 300, the PMU 102 causes the measurement circuitry216 to measure I-battery, while the power transistor 204 is allowingI-charge to flow. Then, the power management unit 102 uses the drivingcircuitry 302 to turn off the power transistor 204, and to take a secondmeasurement of I-battery. However, since the power supply 106 is notbeing charged while the power transistor 204 is off, the secondmeasurement of I-battery is actually a measure of the supplementalcurrent, I-sup (specifically negative I-sup). In other words, with thepower transistor 204 turned off, the power supply 106 provides power tothe device 100, including the I-sup currents, that the secondmeasurement captures. The PMU 102 then determines the difference betweenthe first measurement and the second measurement to obtain a firstmeasurement of I-charge. In other words,I-charge1=I-battery1−I-battery2, where I-battery1 is the I-batterymeasurement with the power transistor 204 supplying charging current,and I-battery2 is the I-battery measurement with the power transistor204 turned off. After the second measurement, the power management unit102 drives the power transistor 204 to again provide charging current tothe power supply 106. Furthermore, the PMU may obtain a thirdmeasurement, I-battery3, once charging current is again flowing, and maydetermine a second measurement of I-charge asI-charge2=I-battery3−Ibattery2.

The PMU 102 may space the samples of I-battery to avoid device eventsthat have a transitory influence on I-charge. For example, the PMU 102may delay or otherwise reschedule measurements of I-battery to avoidtimes when the device activates or deactivates the PA (e.g., to transmita 2G/3G/4G burst). A PA activation/deactivation signal may be providedto the PMU 102 by a baseband controller chip that schedules such bursts.Furthermore, the PMU 102 may offset (-battery samples on a pseudo-randombasis to avoid regular periodic device activity that might introduce arepeating bias into the measurements. With this framework in mind, thePMU 102 may, for example, nominally take samples every 100 ms, with thethree samples spaced 1 ms apart. However, any other spacing betweensamples or sets of samples may be used, with the spacing dependent onany one or more of the power source characteristics, switching device204 characteristics, power supply 106 characteristics or other devicecharacteristics.

The device model 124 provides a mechanism by which the power managementunit 102 controls I-charge by driving the switching device 204 (or anyother switching device used instead, such as an FET). As an overview,the device model 124 models the gain of the switching device 204 (e.g.,the beta of the PNP transistor). As a result, the charging logic 104 candetermine the I-charge output given the strength of the signal drivingthe switching device 204. The driving signal may be a current in thecase of a BJT switching device, or a voltage in the case of a FETswitching device. The gain may vary widely between switching devices204, but typically changes slowly and most strongly with temperature.The PMU 102 may sample I-battery 5-10 times faster than the rate atwhich the gain changes due to other factors, for example. Although FIG.3 shows the driving circuitry 302 directly driving the switching device204 (e.g., directly driving the base of the PNP transistor), the drivingcircuitry 302 may instead drive intermediate stages first, as will beshown below with respect to FIG. 4.

FIG. 4 shows another view of the PMU 102. A finite state machine (FSM)402 controls the PMU 102, including three loops: a CC-Set loop 404, aCV-Set loop 406, and a PD-Set loop 408. The FSM 402 drives the CC-Setloop 404 with a value representing the desired charging current, drivesthe CV-Set loop with a value responsive to battery voltage (e.g., forend of charging cycle current control), and drives the PD-Set loop 408with a value representing the current that should not be exceeded forpower dissipation control in the switching device 204. The PMU 102applies a restriction logic 410 (e.g., a minimum value selector) toselect the smallest current of the several options for I-charge, and theresulting value is shown as I-cmd, for the actual current commanded forI-charge. In this way, if any control loop needs to restrict orcompletely shut down I-charge, it can do so by restricting or setting tozero its current value input to the restriction logic 410.

The device model 124 provides a device gain (e.g., in the form of 1 overgain) which the multiplier 412 multiplies against I-cmd. The resultingdriving value is delivered through the DAC slew control 414 to drive theswitching device 204. In the example of FIG. 4, the driving circuitry302 drives the switching device 204 through the first stage driver 416.The DAC slew control 414 introduces a gradual turn off and turn onwaveform shape to what would otherwise be a fast transition switchingsignal. Doing so may help reduce RF noise and switching transientstypically produced by fast signal transitions.

The calculation block 418 determines I-charge from, for example, threesamples of I-battery as described above. The three samples of I-batteryyield two measurements of I-charge, also as described above. The twomeasurements of I-charge yield two different error terms compared towhat I-charge current was actually commanded via I-cmd:

I-err1=[I-battery(sample1)+I-battery(sample2)]−I-cmd;

I-err2=[I-battery(sample3)+I-battery(sample2)]−I-cmd;

The PMU 102 may select the I-err for updating the device model 124 byapplying any desired selection function. For example, the PMU 102 mayselect I-err as: I-err=min(I-err1, I-err2).

In other implementations, the PMU 102 may obtain one I-err measurement,or more than two I-err measurements, and combine them in any desired way(e.g., by averaging, weighted averaging, or discarding high or lowvalues) to obtain an I-err value for updating the device model 124.

The device model 124 includes an accumulator 420 and a clip control 422.The accumulator 420 accumulates I-err in an attempt to drive I-err tozero by adjusting the device gain applied to the multiplier 412. Theoptional clip control 422 may prevent the device gain from exceeding aselected programmable clipping ceiling (e.g., 1000), and from fallingbelow a selected programmable clipping floor (e.g., 50). Thus, theaccumulator 420 increases the device gain to drive I-err to zero. Thedevice model 124 may start with an artificially high value of devicegain to ensure that the I-charge starts artificially low, to provide asoft start to the charging process. When the device gain startsartificially high, there will be substantial I-err because I-charge willbe too low compared to I-cmd. The device model 124 responds by reducingthe gain value. As a result, the (1 over gain) term applied to themultiplier increases, thereby increasing the current or voltageeventually driving the switching device 204, leading to increasedI-charge.

The power limiting functions 314 and protection functions 318 are alsopresent in FIG. 4. For example, the CV-Set loop 406 may command reducedcurrent as the battery voltage approaches any desired set point (e.g.,an end of charging voltage). The Verr term shown in FIG. 4 representshow close the battery voltage is to the set point, and as the set pointapproaches, the commanded current may be reduced (and may fall below theCC-Set loop 404 value). As another example, the PD-Set loop 408 mayinclude power control logic 424 for monitoring power dissipation of theswitching device 204. If the power exceeds any selected set point over aselected number of samples, then the power control logic 424 may reduceor drive to zero the commanded current. The power control logic 424 maydetermine the power according to the I-charge and the voltage across theswitching device 204, determined by the calculation block 426 as theexternal power source 108 adapter voltage (Vadp) minus the batteryvoltage (Vbat). The power control logic 424 may limit the commandedcurrent to a value 10% lower (or another programmable value) than thecurrent that would result in the maximum allowed power dissipation, forexample.

As another example, the adapter collapse logic 428 may determine whetherthe adapter voltage falls or rises significantly, indicating that morecurrent is trying to be pulled from the adapter than it can supply. Toprevent an undesirable swing in charging current if the adapter suddenlyrecovers, the adapter collapse logic 428 may reduce the commandedcurrent until the adapter voltage has stabilized. Additional protectionsinclude I-charge shutdown when the overcurrent logic 434 detects thattoo much battery current is flowing, and I-charge shutdown when the SARADC 306 detects that the battery voltage exceeds a predeterminedthreshold.

As noted above, the PMU 102 may space the samples of I-battery to avoiddevice events that have a transitory influence on I-charge. For example,the PMU 102 may delay or otherwise reschedule measurements of I-batteryto avoid times when the device activates or deactivates the PA (e.g., totransmit a 2G/3G/4G burst). Furthermore, the PMU 102 may offsetI-battery samples on a pseudo-random basis to avoid regular periodicdevice activity that might introduce a repeating bias into themeasurements. To accomplish these goals, the PMU 102 may include thesample control logic 430. The sample control logic 430 may include onemore programmable timers that set the sample period (e.g., 100 ms), aswell as one or more pseudo-randomization counters that add an offset tothe sample time for a set of samples or to individual samples. Theoffset may vary widely, but in one implementation it may be plus orminus 10% (e.g., a set of three samples starts every 90 ms to 110 ms).The PA input signal 432 may cause any of the timers in the samplecontrol logic 430 to halt while the PA signal is asserted, so thatsamples are not taken during PA activity.

There need not be a strict division between what is considered thecharging logic 104 and what is considered the PMU 102. The charginglogic 104 may represent the entire PMU 102. In other views, the charginglogic 104 may represent a subset of the PMU 102, such control loops 404,406, 408 and FSM 402. The charging logic 104 may further be consideredto include the device model 124.

FIG. 5 shows example waveforms 500 of taking battery currentmeasurements. FIG. 5 shows a DAC enable output 502, a DAC output 504,and a sampling waveform 506 showing when the three I-battery samples aretaken. In addition, FIG. 5 shows a charger current (I-charge) waveform508, a system current (I-system) waveform 510, and a battery current(I-battery) waveform 512. In particular, the PMU 102 provides the DACenable output 504 to the slew control 414, which generates the DACoutput 504. The DAC output 504 turns the switching device 204 on and offin a controlled manner.

At point 1, the PMU samples I-battery with the switching device 204 onto obtain the first I-battery sample 514. At point 2, the PMU has turnedoff the switching device 204 and the charging current has thereforefallen to zero. The power supply 106 therefore supplies I-system at thetime of the second I-battery sample 516. At point 3, the PMU has turn onthe switching device 204 and the charging current has resumed flowingfrom the power source 108 when the third I-battery sample 518 is taken.Any I-battery sample may be randomized in time using a random offset tothe nominal sample spacing of (for example) 1 ms every 100 ms.Furthermore, if the baseband controller asserts a PAactivation/deactivation signal, the PMU may delay taking the I-batterysample until the PA activation/deactivation signal is de-asserted.

FIG. 6 shows an example 600 of how the device model 124 may beimplemented. The three samples described above are represented as thefuel gauge inputs (FGin[13:0]), while the commanded current isrepresented as Icmd[9:0]. Different implementations may use differentbit resolutions for these parameters. The adders 602 produce the twovalues of I-err noted above, while the selection and limiting logic 604selects an I-err value (e.g., by selecting the minimum or I-err1 andI-err2), and may also limit the I-err value from exceeding a selectedprogrammable ceiling value or falling below a selected programmablefloor value. The filter 606 may implement the gain accumulator 420, withthe accumulator loop feedback value al determined according to:

$a_{1} = {\left( \frac{- 1}{{{Ts}*w_{p}} + 1} \right) = \left( \frac{{- f_{s}}/f_{p}}{{2\; \pi} + {f_{s}/f_{p}}} \right)}$

where Ts represents the sampling period, wp represents the polefrequency in radians, fs represents the sampling clock frequency(Ts=1/fs), and fp represents the pole frequency (wp−2×pi×fp). Thisequation represents the A1 feedback term 606 that implements a low passfilter function with a pole location at fp. The pole location fp may bechosen to be 5 to 10 times lower than the sampling clock frequency fs.The low pass filter function integrates the selected error 604 andallows the overall feedback loop 600 to drive this error to zero in acontrolled manner.

FIG. 7 shows an example of soft start 700. As noted above, the devicemodel 124 may start with an artificially high value of device gain toinitially keep I-charge low during a soft start period 702. At multiplepoints in time as the PMU 102 operates, the PMU measures I-charge, andadjusts the device gain supplied to the multiplier 412 to drive theI-err to zero and reach the commanded current I-cmd. In FIG. 7, thedevice model 124 reduces device gain in a controlled manner from theinitial artificially high value 704 through the series of reduced gainvalues 706, 708 and 712 to reach the nominal gain point 714 whereI-charge=I-cmd. At each change in device gain, I-charge increases towardthe commanded value, I-cmd, as indicated by I-charge measurements 716,718, 720, 722, and 724.

FIGS. 8, 9, and 10 represent different examples 800, 900, and 1000respectively of how the power management unit 102 increases chargingcurrent toward a commanded value with different accumulator loopfeedback values. FIG. 8 shows an example in which a1=2, FIG. 9 shows anexample in which a1=8, and FIG. 9 shows an example in which a1=32. Asthe Figures show, increasing the accumulator loop feedback value makesthe device model 124 adjust the charging current more quickly to thecommanded current, I-cmd.

FIGS. 11, 12, and 13 show different examples 1100, 1200, and 1300respectively of how the power management unit 102 increases chargingcurrent toward a commanded value assuming different gains for switchingdevices. FIG. 11 shows an example in which gain=50, FIG. 12 shows anexample in which gain=200, and FIG. 13 shows an example in whichgain=900. As the Figures show, as the gain of the switching device 204increases, it takes less time for the device model 124 to adjust thecharging current to the commanded current, I-cmd. One reason for this isthat the device model starts with what was presumed to be anartificially high gain. Thus, it takes longer for the charging currentto reach I-cmd when the gain of the switching device is relatively low(50 or 200, as examples), compared to the situation in which the gain ofthe switching device is 900, and actually is close to the presumedartificially high starting value (e.g., which may be 1000).

FIG. 14 shows logic 1400 that a power management unit may implement. Thelogic 1400 sets an initial gain parameter in the device model 124 (602).For example, the initial gain parameter maybe set artificially high,e.g., at 1000. The logic 1400 also sets the commanded charging current(604), using, for example, the CC-Set loop 404 or other control loops inthe PMU102 and the restriction logic 410. When the time to sampleI-battery has arrived (e.g., every 100 ms), the PMU 102 may offset eachsample with a pseudo random offset (606), and may also delay any sampleuntil the PA signal is de-asserted (608).

As described above, the logic 1400 takes a first I-battery sample withthe switching device 204 active and supplying I-charge (610). The logic1400 takes a second I-battery sample with the switching device 204inactive and with the power supply 106 supplying the system current(612). In addition, the logic 1400 takes a third I-battery sample withthe switching device 204 active (614). From these three measurements,the logic 1400 determines I-charge1 and I-charge2, as well as thecorresponding error terms I-err1 and I-err2 (616).

The logic 1400 selects between I-err1 and I-err2 (618), for example bychoosing the minimum value. The selected I-err is provided to the devicemodel 124 (620) which updates the modeled device gain (622) in responseto I-err. The device model 124 may limit the device gain (624) to ensurethat it does not exceed a maximum or fall below a minimum value. Thedevice model outputs the updated device gain to control I-charge (626).

The PMU 102 may be described in many ways, with one example given above.As another example, the PMU 102 may be described as including aswitching device control output for controlling a switching device 204,a device power supply 106 current measurement input, and a switchingdevice model 124 comprising a model parameter for the switching device(e.g., gain or beta). The power management unit is configured todetermine, from the device power supply current measurement input,charging current drawn from a charging power source and adjust theswitching device control output according to the model parameter tocontrol the charging current (e.g., toward a commanded value I-cmd).

The PMU 102 may be configured to determine the charging current bytaking a first measurement from the device power supply currentmeasurement input while the switching device control output permits thecharging current to flow through the switching device, taking a secondmeasurement from the from the device power supply current measurementinput while the switching device control output has stopped the chargingcurrent from flowing through the switching device, determining thedifference between the first measurement and the second measurement. ThePMU 102 may also make any number of additional measurements of thecharging current for use in updating the device model 124.

In operation, the PMU 102 may implementing a charging starting period(e.g., a soft start) by driving the switching device control outputaccording to the model parameter set to initially reduce the chargingcurrent. The PMU 102 may also determine the charging current at multiplepoints in time, and after at least one of the multiple points in time,drive the switching device control output to increase the chargingcurrent, e.g., toward a commanded value I-cmd. The multiple points intime may be pseudo-random points in time, and may avoid activation ordeactivation of a power amplifier or other noisy circuitry in the device100.

The methods, devices, and logic described above may be implemented inmany different ways in many different combinations of hardware, softwareor both hardware and software. For example, all or parts of the systemmay include circuitry in a controller, a microprocessor, or anapplication specific integrated circuit (ASIC), or may be implementedwith discrete logic or components, or a combination of other types ofanalog or digital circuitry, combined on a single integrated circuit ordistributed among multiple integrated circuits. All or part of the logicdescribed above may be implemented as instructions for execution by aprocessor, controller, or other processing device and may be stored in atangible or non-transitory machine-readable or computer-readable mediumsuch as flash memory, random access memory (RAM) or read only memory(ROM), erasable programmable read only memory (EPROM) or othermachine-readable medium such as a compact disc read only memory (CDROM),or magnetic or optical disk. Thus, a product, such as a computer programproduct, may include a storage medium and computer readable instructionsstored on the medium, which when executed in an endpoint, computersystem, or other device, cause the device to perform operationsaccording to any of the description above.

The charging control capability of the system may be distributed amongmultiple system components, such as among multiple processors andmemories. Parameters, models, and other data structures may beseparately stored and managed, may be incorporated into a single memoryor database, may be logically and physically organized in many differentways, and may implemented in many ways, including data structures suchas linked lists, hash tables, or implicit storage mechanisms. Programsmay be parts (e.g., subroutines) of a single program, separate programs,distributed across several memories and processors, or implemented inmany different ways, such as in a library, such as a shared library(e.g., a dynamic link library (DLL)). The DLL, for example, may storecode that performs any of the charging control described above. Whilevarious embodiments of the invention have been described, it will beapparent to those of ordinary skill in the art that many moreembodiments and implementations are possible within the scope of theinvention. Accordingly, the invention is not to be restricted except inlight of the attached claims and their equivalents.

What is claimed is:
 1. A method comprising: measuring charging currentflowing from a charging power source by instead measuring batterycurrent flowing through a rechargeable battery connected to the chargingpower source, the charging current comprising rechargeable batterycurrent and supplemental current; controlling the charging current usinga model parameter of a device model for a switching device through whichthe charging current flows.
 2. The method of claim 1, where: thesupplemental current comprises digital logic current, power amplifiercurrent, or both.
 3. The method of claim 1, where the model parametercomprises gain of the switching device.
 4. The method of claim 1, wherecontrolling comprises: increasing the charging current over time.
 5. Themethod of claim 1, where controlling comprises: increasing the chargingcurrent over time after measuring the charging current to ensure it iswithin predetermined boundaries.
 6. The method of claim 1, wheremeasuring charging current comprises: taking a first measurement of thebattery current while the charging current is flowing to therechargeable battery; taking a second measurement of the battery currentwhile the charging current has stopped flowing to the rechargeablebattery; and determining the difference between the first measurementand the second measurement.
 7. A charging system comprising: chargingcircuitry comprising: a switching device; and a battery current sensorin communication with the switching device; a power management unitcomprising: a switching model for the switching device; a switch driverfor the switching device; and charging current measurement logicoperable to: drive the switching device with the switch driver toprovide charging current, including battery current that flows throughthe battery current sensor, and obtain a first measurement of thebattery current; deactivate the switching device with the switch driverto stop the charging current, and obtain a second measurement of thebattery current; determine the charging current from the firstmeasurement and the second measurement; and control the charging currentby driving the switching device according to the switching model.
 8. Thecharging system of claim 7, where the switching model comprises a gainparameter for the switching device.
 9. The charging system of claim 7,where the power management unit is operable to control the chargingcurrent by increasing the charging current over time.
 10. The chargingsystem of claim 7, where the power management unit is operable tocontrol the charging current by increasing the charging current overtime starting when a charging operation begins.
 11. The charging systemof claim 10, where the power management unit is operable toincrementally increase the charging current.
 12. The charging system ofclaim 10, where the power management unit is operable to incrementallyincrease the charging current after obtaining a charging currentmeasurement and determining that the charging current measurement meetsa charging current criteria.